<!DOCTYPE html>
<html>
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <title>公共聊天室-基于swoole扩展php开发</title>
    <meta name="description" content="公共聊天室，聊天室基于swoole扩展、PHP开发">
    <meta name="keywords" content="聊天室，公共聊天室，梦的起飞，swoole，扩展，PHP开发">
    <link media="all" href="./static/css/style.css?v=2222" type="text/css" rel="stylesheet">
    <link media="all" href="./static/css/shake.css?v=2222" type="text/css" rel="stylesheet">
</head>
<body>
<div id="layout-container">
    <div id="layout-main">
        <div id="header">
            <div style="float: right;margin: 17px 15px 4px 0px;">
                <!--<div title="退出" class="iconfont" onclick="chat.logout()" style="height: 26px;width: 26px;color: #EDF7FF;font-size: 26px;line-height: 26px;cursor: pointer;"></div>-->
            </div>
            <div class="search-bar-wraper" style="width: 268px;">Making a Web Chat With easyswoole</div>
        </div>
        <div id="body">
            <div id="menu-pannel">
                <div class="profile"></div>
                <ul class="main-menus" id="main-menus"></ul>
            </div>
            <div id="menu-pannel-body">
                <div id="sub-menu-pannel" class="conv-list-pannel">
                    <div class="conv-lists-box" id="user-lists">
                        <div class="conv-lists" id="conv-lists"></div>
                    </div>
                </div>
                <div id="content-pannel">
                    <div class="conv-detail-pannel">
                        <div class="nocontent-logo" style="display:none;">
                            <div>
                                <img alt="欢迎" src="./static/images/noimg.png">
                            </div>
                        </div>
                        <div class="content-pannel-body chat-box-new" id="chat-box">
                            <div class="main-chat chat-items" id="chat-lists">
                                <div class="msg-items" id="chatLineHolder"></div>
                            </div>
                        </div>
                        <div>
                            <div class="send-msg-box-wrapper">
                                <div class="input-area" style="display:none;">
                                    <ul class="tool-bar">
                                        <li class="tool-item">
                                            <i class="iconfont tool-icon tipper-attached emotion_btn" title="表情"></i>
                                            <div class="faceDiv"></div>
                                        </li>
                                        <li class="tool-item">
<!--                                            <input type="file" class="notFormFile"/>-->
                                            <i class="iconfont tool-icon icon-card tipper-attached" title="图片" onclick="upload()"></i>
                                        </li>
                                    </ul>
                                    <span class="user-guide">Enter 发送 , Ctrl+Enter 换行</span>
                                    <div class="msg-box" style="height:100%;">
                                        <textarea class="textarea input-msg-box" onkeydown="chat.keySend(event);"
                                                  id="chattext"></textarea>
                                    </div>
                                </div>
                                <div class="action-area" style="display:none;">
                                    <a href="javascript:;" class="send-message-button"
                                       onclick="chat.sendMessage()">发送</a>
                                </div>
                                <div id="loginbox" class="area" style="width:100%;text-align:center;display:block;">
                                    <form action="javascript:void(0)" onsubmit="return chat.doLogin('','');">
                                        <div class="clearfix" style="margin-top:35px">
                                            <input name="name" id="name" style="margin-right:20px;width:250px;"
                                                   placeholder="请输入昵称" class="fm-input" value="" type="text">
                                            <input id="email" class="fm-input" style="margin-right:20px;width:250px;"
                                                   name="email" placeholder="请输入Email" type="text">
                                            <button type="submit" class="blue big">登录</button>
                                        </div>

                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="carrousel"><span class="close entypo-cancel"></span>
    <div class="wrapper"><img src="./static/images/noimg.png"/></div>
</div>
<script src="./static/js/init.js"></script>
<script src="./static/js/jquery.min.js"></script>
<script src="./static/js/face.js?v=3345"></script>
<script src="./static/js/create.div.js?v=1"></script>
<script src="./static/js/chat.script.js?v=26"></script>
<script src="./static/js/functions.js?v=2115"></script>
<script src="./static/js/xlyjs.js?v=215"></script>
<script src="./static/js/layer-v3.1.1/layer/layer.js"></script>

<script>
    $("#btnNotForm").click(function () {
        var upload = "/upload/wsUpload";//远程上传接口
        var formData = new FormData();//初始化一个FormData对象
        formData.append("img", $(".notFormFile")[0].files[0]);//将文件塞入FormData
        $.ajax({
            url: upload,
            type: "POST",
            data: formData,
            processData: false,  // 告诉jQuery不要去处理发送的数据
            contentType: false,   // 告诉jQuery不要去设置Content-Type请求头
            success: function (responseText) {
                chat.data.type = 2;
                var json = {
                    "class": "Index",
                    "action": "index",
                    "param": {
                        "type": chat.data.type,
                        "name": chat.data.name,
                        "avatar": chat.data.avatar,
                        "message": responseText.msg.url,
                        "c": 'img',
                        'roomid': chat.data.crd
                    }
                };
                chat.wsSend(JSON.stringify(json));
            }
        });
    });
</script>
</body>
</html>
